﻿using Microsoft.EntityFrameworkCore;
using System.Text.RegularExpressions;

namespace _3_NovaAdmin.Domain.Aggregates;

[Table("ChatGroup")]
public class ChatGroup : Entity<Guid>, IAggregateRoot
{
    public ChatGroup() { }


    public string GroupName { get; set; }

    public string GroupImg { get; set; }

    private List<GroupMember> _members = new();

    public void AddMember(Guid userId)
    {
        _members.Add(new GroupMember(userId, Id));
    }

    // 其他方法（如移除成员等）
    public void RemoveMember(Guid userId)
    {
        //   await _context.GroupMembers
        //.Where(m => m.GroupId == groupId && m.UserId == userId)
        //.ExecuteDeleteAsync(); //使用ExecuteDelete实现高效删除（无需查询）
    }
}
